import React, { PureComponent } from 'react';
import { Form, Input, Select, Row, Col } from 'antd';

const { Option } = Select;

export default class Index extends PureComponent {
  render() {
    const { form, unitName = "", data = {} } = this.props;
    const { getFieldDecorator } = form;

    return (
      <Form layout='vertical'>
        <Form.Item label='单位名称'>
          {getFieldDecorator('unit_name', {
            initialValue: unitName,
            rules: [{ required: true, message: '该项为必填项' }],
          })(
            <Input placeholder='请输入单位名称' size='large' disabled={true}/>
          )}
        </Form.Item>
        <Form.Item label='职务名称'>
          {getFieldDecorator('duty_name', {
            initialValue: data.duty_name || undefined,
            rules: [{ required: true, message: '该项为必填项' }],
          })(
            <Input placeholder='请输入职务名称' size='large' />
          )}
        </Form.Item>
      </Form>
    );
  }
}